﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Crawler.Core.EventBus
{
    public interface IEventBus
    {
        /// <summary>
        /// 发布
        /// </summary>
        /// <typeparam name="EventEntity"></typeparam>
        /// <param name="t"></param>
        void Publish<EventEntity>(EventEntity t) where EventEntity: IEventEntity;

        /// <summary>
        /// 订阅
        /// </summary>
        /// <typeparam name="EventHandler"></typeparam>
        /// <typeparam name="EventEntity"></typeparam>
        void Subscribe<EventHandler, EventEntity>()where EventHandler:IEventHandler<EventEntity> where EventEntity: IEventEntity;
    }
}
